package com.exercise.AndroidCamera;

import android.content.Intent;
import android.hardware.Camera;
import android.hardware.Camera.CameraInfo;
import android.os.Bundle;

import com.telpoo.frame.delegate.Idelegate;
import com.telpoo.frame.ui.BaseActivity;

public class FinInfo extends BaseActivity {

	@Override
	protected void onCreate(Bundle arg0) {
		super.onCreate(arg0);

		boolean haveFrontCamera = false;

		int numCameras = Camera.getNumberOfCameras();

		for (int i = 0; i < numCameras; i++) {
			Camera.CameraInfo info = new CameraInfo();
			Camera.getCameraInfo(i, info);
			if (CameraInfo.CAMERA_FACING_FRONT == info.facing) {
				haveFrontCamera = true;
			}

		}

		String text = "number of camera:" + numCameras
				+ " \n is has a front camera:" + haveFrontCamera;
		MyUtils.dialog(FinInfo.this, text, new Idelegate() {

			@Override
			public void callBack(Object value, int where) {

				startActivity(new Intent(FinInfo.this, AndroidCamera.class));
				
			}
		});

	}

}
